'''
图像列表
'''
import re

USER_NAME = "root"
USER_PASSWORLD = "My265746!"
IP_ADDRESS = "192.168.184.101"
DATEBASE = "rebot"
IP_PORT = 3306

LONG_TIME_IMAGE = {
    "from_move_x": "0",
    "from_move_y": "0",
    "lable_image_name": "spare_time_reading",
    "lable_image_num": "60",
    "lable_size_wight": "200",
    "lable_size_height": "200",
    "lable_move_x": "230",
    "lable_move_y": "200",
    "lable_two_image_name": None,
    "lable_two_image_num": None,
    "lable_two_image_wight": None,
    "lable_two_image_height": None,
    "lable_two_move_x": None,
    "lable_two_move_y": None,
    "txt_content": None
}

A = {
'analysis_image': 115,

    'touring_image': 67,
    'answer': 97,
    'appear': 65,
    'alarm_image': 78
}

IMAGE_DICT = {
'appear': 65,
'spare_time_reading': 60
}

OUT_OF_MEMORY = {
    'analysis': 115,
    'talk_intercom': 75,
    'inquire': 70,
    'alarm_not_talk': 78
}

NOT_TAKLE = {
    'statistical_work_image': 103,
    'attendance_report': 94,
    'disappear': 65,
    'map_location_report': 107,
    'repair': 75,
    'report_eye': 95,
    'report_eye_not_mouth': 95,
    'report_mouth': 95,
    'research_data': 92,
    'say_hello': 106,
    'statistical_work': 103,
    'touring': 67,
    'weather_cloudy': 114,
    'weather_rain': 104,
    'weather_snow': 105,
    'weather_sunny': 97,
    'weather_turned_clear_and_cloudy': 114,
    'alarm_talk': 78
}

REBOT_ACTION_BOT_WHICH = ["appear", "map_location_report", "disappear", "attendance_report", "report_eye",
                          "report_eye_not_mouth", "report_mouth", "say_hello", "talk_intercom", "weather_cloudy",
                          "weather_rain", "weather_snow", "weather_sunny", "weather_turned_clear_and_cloudy"]
REBOT_ACTION_TWO_QLABLE_IMAGE = ["alarm_image", "analysis_image", "statistical_work_image", "touring_image"]
REBOT_ACTION_BOT_TXT = ["dialog_box"]

GET_TXT_SIZE = """SELECT txt_brow_name,txt_brow_num,txt_brow_wight,txt_brow_height,txt_brow_move_x,txt_brow_move_y FROM MIYANG.TXT_SIZE"""
GET_TXT_QSS = """SELECT font_size,padding_top,padding_right,padding_bottom,padding_left FROM MIYANG.TXT_QSS_"""

NetAddressTTS = "10.131.162.4:18297"
NetAddressAsr = "10.131.162.4:18298"
NetAddressNip = "10.131.162.4:18299"


def FuncReduceHttpRequest(rec):
    '''
    处理数据
    获取发送过来的数据
    :return:
    '''
    request_lines = rec.splitlines()
    request_start_line = request_lines[0]
    file_name = re.match(r"\w+ +/([^ ]*) ", request_start_line).group(1)
    return str(file_name)

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import os

def ChromeDriveTest():
    try:
        ret = None
        chrome_options = Options()
        chrome_options.add_experimental_option("debuggerAddress", setting.value("ChromeWebdrive/chromeipAdress"))
        objDrive = webdriver.Chrome()
        objDrive.get("https://echarts.apache.org/zh/tutorial.html#5%20%E5%88%86%E9%92%9F%E4%B8%8A%E6%89%8B%20ECharts")


    except Exception as f:
        print(f.__traceback__)
        # logging.error(traceback.format_exc())


ChromeDriveTest()

